UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yJnLb7XOJVdbsKZNUQq/MujCy5yZDp+wclScTs5/g7Q=' 
WHERE 
  key_id = 'bfbdf30ed06212d08ad8703ab0ae7cab280b6db40c137756cff26456c8002064' 
  AND (
    token = 'yJnLb7XOJVdbsKZNUQq/MujCy5yZDp+wclScTs5/g7Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021