UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dELok2vdrr9UAqjRNyDkS4DT6bAVP6afqCLYnMAwvM4='
WHERE
key_id = '8ff3bcdc2992518cc1a9d8fd5142c31d483d643c487296e334132472215316a2'
AND (
token = 'dELok2vdrr9UAqjRNyDkS4DT6bAVP6afqCLYnMAwvM4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)