UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xTrjsdwivJRU+dIWiczUx3UjZ3Q/FAxZjgbUZMsxIPo=' 
WHERE 
  key_id = '115f34666009e70ccb63fda222694a751f8c48bbcc33b7223f1ba4ff5cba8aee' 
  AND (
    token = 'xTrjsdwivJRU+dIWiczUx3UjZ3Q/FAxZjgbUZMsxIPo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035