UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7jVG/3k3nyooTAWU2G3LDDoj/1Vxmh14F8sWREk/JnA='
WHERE
key_id = '0244c9bd486acdd09799351234d65f4fd22207c747335c6912aa4b6409bda68e'
AND (
token = '7jVG/3k3nyooTAWU2G3LDDoj/1Vxmh14F8sWREk/JnA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)