UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FneghUHwscVJoThlXtzSu2dUtnOu6NLGiV15QMlUZMQ=' 
WHERE 
  key_id = 'c10aaa4355bc50b5d8f3d322c0c8707a7a1d41d39af7cce5152ffca8c6ad8291' 
  AND (
    token = 'FneghUHwscVJoThlXtzSu2dUtnOu6NLGiV15QMlUZMQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030