UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sZN9wLBbSShu4jaqYIsuE6LvgDXrNgWTGkAS31KdQXQ='
WHERE
key_id = '7c4c07a74314b26b3f7463c77b3e6a58efc452cc12a78dcf8b9f6311d544ad75'
AND (
token = 'sZN9wLBbSShu4jaqYIsuE6LvgDXrNgWTGkAS31KdQXQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)