UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8k/8Ydr9g4lqckOv6WTJzEC1p0cOxT20hmNCstKbDbw='
WHERE
key_id = '6fea09cc8161dd303d08097537b675ef012d20a3844c026b18321059e3c5c6c2'
AND (
token = '8k/8Ydr9g4lqckOv6WTJzEC1p0cOxT20hmNCstKbDbw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)