UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IcBpJkSFEPINMRVoJFBayMuVZnOrStJDDoQcEIT0qdk='
WHERE
key_id = 'df1ef193ed4aacc354e65630ac5a428c21275019ac902a0fc4f7da8a33925be4'
AND (
token = 'IcBpJkSFEPINMRVoJFBayMuVZnOrStJDDoQcEIT0qdk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)