UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+xmaR77edpHoLitZ13Cdr1BbQkmFCZCGwNsiswawj30=' 
WHERE 
  key_id = 'c08042c2da8bd57a2d7674289af3a622afc0479b47e94c6266bd9f91234e913b' 
  AND (
    token = '+xmaR77edpHoLitZ13Cdr1BbQkmFCZCGwNsiswawj30=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031