UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TcVIWX8TIw4UVvZ/NXK5Srv1GQc2maO/dmu5Q9YdS4A=' 
WHERE 
  key_id = '337afa0846a2f683071b505f6eed8846d0d5811b26742dd7b3fd70c0e580e757' 
  AND (
    token = 'TcVIWX8TIw4UVvZ/NXK5Srv1GQc2maO/dmu5Q9YdS4A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016