UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'L2cVXyHpzMpzLse8uPp9Iz24UMryTYj3B/YRm/aLhsw='
WHERE
key_id = '4ab88afc2a9f481a43b5fbbc52e38099c341cc2cbf346861ee43e4fe953453ff'
AND (
token = 'L2cVXyHpzMpzLse8uPp9Iz24UMryTYj3B/YRm/aLhsw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)