UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jDXWr+/l0lNCsWism/r5G48JHyt+MOiXCJzy/uTojco='
WHERE
key_id = 'a05ce38249140b313fcc87e74b23b315442349cca672a17f010afff5a6cc1d3b'
AND (
token = 'jDXWr+/l0lNCsWism/r5G48JHyt+MOiXCJzy/uTojco='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)