UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 't0MVoojYeuEd8dISkibSSeZFmr4NkvsTXSmnrkvSgKk='
WHERE
key_id = 'dc67158478a42dbc783a40984a7f94401e9a9749d5f9c497dc633712507563bb'
AND (
token = 't0MVoojYeuEd8dISkibSSeZFmr4NkvsTXSmnrkvSgKk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)