UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UuLRzjTmuJuGqj4M++YdDx/L0fJwL47nTpY7PzyarEU=' 
WHERE 
  key_id = 'f7623236754a33aee10149ec016d7d15a0f1d949bb3aeb3c81351c72ced865e7' 
  AND (
    token = 'UuLRzjTmuJuGqj4M++YdDx/L0fJwL47nTpY7PzyarEU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035