UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '55OKD9yuYcxkysLGWxIo1tIVM3KCshs8JP6yufYLekM='
WHERE
key_id = '8de83f7932929c3970bf45bd26ff1ceacb8a14e628190825f78263ea91e39ba0'
AND (
token = '55OKD9yuYcxkysLGWxIo1tIVM3KCshs8JP6yufYLekM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)