UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1O9bSMks/7Swz3vabSx/LFt7i76hBwomsutCv/hSn3w='
WHERE
key_id = '6495ab9fcd79542d5a526844d5697e102006259787c54d3bd7971fa00f559c1c'
AND (
token = '1O9bSMks/7Swz3vabSx/LFt7i76hBwomsutCv/hSn3w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)