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