UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DgLX6mz1g4fWNQuPusa2vp1zVpmir+rXChEdwfjVWns='
WHERE
key_id = '5814f71258762c4b9f7ed03be515821e2b476eaa0ac54ec75f6999d766dd1aeb'
AND (
token = 'DgLX6mz1g4fWNQuPusa2vp1zVpmir+rXChEdwfjVWns='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)