UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YmnfBFUpGsJ3pADTCFeapZmMuQKSVbiZ3T7pfrcj+1c=' 
WHERE 
  key_id = '67172d9a9e2eaf0aa4e8d98aca3d393c2d52cf7d56225b3db0346233c0f902a2' 
  AND (
    token = 'YmnfBFUpGsJ3pADTCFeapZmMuQKSVbiZ3T7pfrcj+1c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020