UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vgezx0HuwLAp+w41siDP+beoIcZIIazvyAzaE0AqGvU='
WHERE
key_id = '3052e5b5f78007685950f21d7e8de38e7591efde19d9e1b05a0cf280cd0128ff'
AND (
token = 'vgezx0HuwLAp+w41siDP+beoIcZIIazvyAzaE0AqGvU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)