UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/bDY9G6Sm2LPgZ8BFE00XswggyUUL271lIfE+vRzFZQ='
WHERE
key_id = '25345485c85bd10fe9045844724dc5a900334d4e49c67e3ddd8803df8aee3496'
AND (
token = '/bDY9G6Sm2LPgZ8BFE00XswggyUUL271lIfE+vRzFZQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)