UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QxW1ElcQgJyYYUNSpv0tVmuj1Oe8Z1TWNmfuxnHix6o='
WHERE
key_id = '99181770140c7dcda7955503dd18d7e273617226a8ad2674ae371501125a84ca'
AND (
token = 'QxW1ElcQgJyYYUNSpv0tVmuj1Oe8Z1TWNmfuxnHix6o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)