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