UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '58bCf2HTWyD2cK8n1t8kjGj37/XZZMomVCxOgxlz40k='
WHERE
key_id = 'f3623753115d63bbb50b0432b466ac85110ab8ae6cd98b2bc653e0598afb0205'
AND (
token = '58bCf2HTWyD2cK8n1t8kjGj37/XZZMomVCxOgxlz40k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)