UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MBOxuL4gchKHFz4E0FBX1GkWr+FPwKyB+0FPHFzZhqo=' 
WHERE 
  key_id = 'f15f553f516233e7bc38b2826672c3cbe1144c72f0480e78fd3a6f1b98a8f8d7' 
  AND (
    token = 'MBOxuL4gchKHFz4E0FBX1GkWr+FPwKyB+0FPHFzZhqo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026