UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'W/af8lVLyrhYarIAtf54xQm9oM32lmYhWR8KSJD2r/Q=' 
WHERE 
  key_id = '3415a5eedd10e9ac4d96efd5d90814fcf9673781a89c41b0714f3a698ba31d20' 
  AND (
    token = 'W/af8lVLyrhYarIAtf54xQm9oM32lmYhWR8KSJD2r/Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054