UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3plvveUt6cDuJqC6U6sV6rSCOdKIQ6RCfJpHdcmOU84='
WHERE
key_id = '5e092fb5d66a5edd69ee4414a0dc0308026701b39cf004f743d84884d4424731'
AND (
token = '3plvveUt6cDuJqC6U6sV6rSCOdKIQ6RCfJpHdcmOU84='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)