UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KFd/REDIoXraMowkbRkRjEm8U+pJoi2IWhNpB7/3rUY=' 
WHERE 
  key_id = 'cfbf43c23f334ff213d434dacd0098721a0cb423c68bc31e0cae103172309826' 
  AND (
    token = 'KFd/REDIoXraMowkbRkRjEm8U+pJoi2IWhNpB7/3rUY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027