UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5ptRsoI/vu11ZUGcrWtGyIKm6YkLFqtd1Dxz2uBjnoo='
WHERE
key_id = 'a074942b1528e9f8d6e4e2d9496f2e2ee091e3159c6fff6f941852a370793a21'
AND (
token = '5ptRsoI/vu11ZUGcrWtGyIKm6YkLFqtd1Dxz2uBjnoo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)