UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Sytdf7X+xpq2+I3ndixfLFGup+FCBP6q/r0kDzctcOY=' 
WHERE 
  key_id = 'cab07257724e78ded7547633b44b2621955240fb4ee61998194bd73e7613e0cb' 
  AND (
    token = 'Sytdf7X+xpq2+I3ndixfLFGup+FCBP6q/r0kDzctcOY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026