UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+tD8VCTrFIUfhmlmydUusKtP3f2vePec0/hJsqgwbMM='
WHERE
key_id = 'fbb8ce8434b37874f96df672ba1584488d10e153d979a790fbf9ce374a981d04'
AND (
token = '+tD8VCTrFIUfhmlmydUusKtP3f2vePec0/hJsqgwbMM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)