UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UzMSrXWLnSm/2V+Hm1p49J5StaWXHL8/diLHQHfJUos='
WHERE
key_id = '5a237769d592f25a2e52912abf494252a2d6687a9420745f6025d1bd4933a2c8'
AND (
token = 'UzMSrXWLnSm/2V+Hm1p49J5StaWXHL8/diLHQHfJUos='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)