UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Wt9YCHpIm26lJyKnylRmn1+9jNtnY/16HKmVL0X5jdU='
WHERE
key_id = '4ea4bf2d24b36bce57b7b481b1e8e52fbb7ad9d5a1fd16c3fa57777866b1edda'
AND (
token = 'Wt9YCHpIm26lJyKnylRmn1+9jNtnY/16HKmVL0X5jdU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)