UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gxDwQjdBdlfv8uW03M08XJSV69jr21ocnQTySkf4zSU='
WHERE
key_id = '20858f8bf14d43423915200c958d8378c75c633eeb0ecddf2606aa195ebecec2'
AND (
token = 'gxDwQjdBdlfv8uW03M08XJSV69jr21ocnQTySkf4zSU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)