UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MLwWCxPOh1NU3/lrKaAtsj+3dUxrnejjC34BZLFDDQs=' 
WHERE 
  key_id = 'bc9e8148025f50427155dff75aa2e33817e116bc540ea2f53f9b9cba01183568' 
  AND (
    token = 'MLwWCxPOh1NU3/lrKaAtsj+3dUxrnejjC34BZLFDDQs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024