UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nmjCRyILOVbHAvLsgp8RncX51WXszjCoCjbaUUmzMKw='
WHERE
key_id = '2951a7aff280ca2bad9f02ee1a8fd043a411d8cc4e58e56ee984606b669068e3'
AND (
token = 'nmjCRyILOVbHAvLsgp8RncX51WXszjCoCjbaUUmzMKw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)