UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GQ5YojREQ2QOQqcjirKIIUu6mPEWUA116bcvXBO0lyQ=' 
WHERE 
  key_id = '8b6f3779d2d4b8ab8d4df5c44d7d08f7704f7dbe2f3714f629fc700d103280ef' 
  AND (
    token = 'GQ5YojREQ2QOQqcjirKIIUu6mPEWUA116bcvXBO0lyQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038