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