UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0Gj5lJ2bBch+T+/Dq/TTsbozuYCkpU/9Q2xxso8FVMk=' 
WHERE 
  key_id = 'c40e480b2e413cf3eb1c4cfee4d89f383ca5ef0ec67ffcc8bf41d03121311b0f' 
  AND (
    token = '0Gj5lJ2bBch+T+/Dq/TTsbozuYCkpU/9Q2xxso8FVMk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026