UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'v7Ov9D/JLu2ctJrK1r3bIjsl++Jz35IxfoICrnU0OqE='
WHERE
key_id = '30b6fe26369dc213668027a9f454cf967a7cdc6ff0ee0e07be483b02cb2b2ede'
AND (
token = 'v7Ov9D/JLu2ctJrK1r3bIjsl++Jz35IxfoICrnU0OqE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)