UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'F5pPADjvfe9AZYpoBzdI1bvC7R7oa7P6qmAtfgcniF4='
WHERE
key_id = '26330e943d9b093a92d8e13c6766950210710e91106c9e6d5325999dd9e1ad62'
AND (
token = 'F5pPADjvfe9AZYpoBzdI1bvC7R7oa7P6qmAtfgcniF4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)