UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yrKQSZSWEf85DntKgOTB+6ohkl9fYoPZ8EPLZOEuLfY='
WHERE
key_id = 'f4d3fa9abeb4a80f7946ec14c39f0c0e7c1c45a1733e6ca6573b6c0d8e8dd45e'
AND (
token = 'yrKQSZSWEf85DntKgOTB+6ohkl9fYoPZ8EPLZOEuLfY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)