UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vn93MwC5yDZKGK4mw7i/evWn7kM03Cd9lpJPNxvZFv4=' 
WHERE 
  key_id = '3822f969d88f4ffb34760fa5e4683ac201732f8301230fb7b171d1b8d27eadc4' 
  AND (
    token = 'vn93MwC5yDZKGK4mw7i/evWn7kM03Cd9lpJPNxvZFv4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030