UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'r/lCiGoUWBMh1DCP1KaWKL6IIm9gX3tKdM8N4b794AE='
WHERE
key_id = '85e97a248ba7c71c32f3ce90f58508afffdb40ffc728585dd0b923823bc57b4e'
AND (
token = 'r/lCiGoUWBMh1DCP1KaWKL6IIm9gX3tKdM8N4b794AE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)