UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XXSL6nh01ARfJ6pna4aVPjpGqWGe5+9NpN+qPdqdgxQ='
WHERE
key_id = 'd11e10d3794d3fe7b91d5000229de021545fee8b7e52d26083db5a683124b78d'
AND (
token = 'XXSL6nh01ARfJ6pna4aVPjpGqWGe5+9NpN+qPdqdgxQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)