UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Q16BUwc9a75vWHX574C6xFXJElKlCZqFTdMu0Bhqezk=' 
WHERE 
  key_id = 'b1c73bed3d4a1a8174fd8d012624f8e578730aa84ea74b01be61d5292e0580eb' 
  AND (
    token = 'Q16BUwc9a75vWHX574C6xFXJElKlCZqFTdMu0Bhqezk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00014